<%@ Page Language="VB" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="false" CodeFile="appFMSA.aspx.vb" Inherits="admin_appFMSA" title="Admin - Application Settings - FMSA Agency Set Up" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>
<%@ Register Src="SubNavControls/AppSubNavControl.ascx" TagName="AppSubNavControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:ObjectDataSource runat="server" id="CountyODS" DataObjectTypeName="Cdm.DataCore.LookupTables.LuCounty" SelectMethod="ListAll" TypeName="Cdm.DataCore.LookupTables.LuCounty">
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="FmsaObjectDataSource" DataObjectTypeName="Cdm.DataCore.Entities.FMSA" TypeName="Cdm.DataCore.Entities.FMSA" SelectMethod="ListBySort"
         UpdateMethod="UpdateInstance" InsertMethod="SaveInstance" DeleteMethod="RemoveInstance" runat="server" SortParameterName="sortExpr"></asp:ObjectDataSource>
    
<uc1:AppSubNavControl ID="SubNavCtrl" runat="server" />

<table cellpadding="0" cellspacing="0">
       <tr><td width="20px" rowspan="4"></td><td><h1><a id="pagecontent">Admin - Application Settings - <asp:Label ID="FmsaLabel" runat="server">FMSA Agency</asp:Label> Set Up</a></h1></td></tr>
       <tr><td><cc2:ValidationErrorSummary ID="ErrorSummary" runat="server" Message="" Visible="false" /></td></tr>
       <tr><td>
                <cc2:ScrollingGridView ID="FMSAScrollingGridView" runat="server" CssClass="gridOffsetSmall" HorizontalAlign="Center" IsFixedColumn="true"  CellPadding="5" ToolTip="170"
                                AutoGenerateColumns="False" DataSourceID="FmsaObjectDataSource" BorderColor="#21334B" 
                                BorderStyle="Solid" GridLines="Vertical" DataKeyNames="FMSAId" AllowSorting="True">
                            <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
                            <RowStyle CssClass="adminColumnStyle" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Agency" SortExpression="AgencyName">
                                    <ItemStyle Width="500px" />
                                    <HeaderStyle Width="506px" />
                                        <ItemTemplate><%# Eval("AgencyName") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Active" SortExpression="IsActive">
                                    <ItemStyle Width="150px" />
                                    <HeaderStyle Width="150px" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="IsActiveCheckBox" runat="server" Enabled="false" Checked='<%#Eval("IsActive") %>' />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:CommandField HeaderText="Action" ShowEditButton="True" ItemStyle-Width="125px" HeaderStyle-Width="155px" />
                                </Columns>
                            <AlternatingRowStyle BackColor="#E8ECF4" />
                </cc2:ScrollingGridView>
                </td></tr>
                   <tr><td>
                   <asp:Panel ID="DetailsPanel" Height="200px" ScrollBars="Auto" runat="server">
                   <asp:DetailsView ID="FmsaDetailsView" runat="server" CssClass="gridOffset" 
            Width="825px" AutoGenerateRows="False" DataSourceID="FmsaObjectDataSource" 
            DefaultMode="Insert" GridLines="None" Visible="False">
            <Fields>
                <asp:TemplateField>
                <ItemTemplate>
                    <table border="0" cellpadding="3" cellspacing="0">
                        <tr>
                            <td align="right">
                                <asp:Label ID="AgencyNameLabel" runat="server" AssociatedControlID="FieldNameTextBox" Text="Agency Name*:" Font-Bold="true" CssClass="labelSmall"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="FieldNameTextBox" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:Label ID="StreetAddress1Label" runat="server" CssClass="labelSmall" AssociatedControlID="txtSA1">Street Address 1:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSA1" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="StreetAddress2Label" runat="server" CssClass="labelSmall" AssociatedControlID="txtSA2">Street Address 2:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSA2" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:Label ID="StreetAddress3Label" runat="server" CssClass="labelSmall" AssociatedControlID="txtSA3">Street Address 3:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSA3" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                        </tr> 
                        <tr>
                            <td align="right">
                                <asp:Label ID="StreetAddessCityLabel" runat="server" CssClass="labelSmall" AssociatedControlID="txtSACity">City:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSACity" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:Label ID="StreetAddressStateLabel" runat="server" CssClass="labelSmall" AssociatedControlID="txtSAState">State:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSAState" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                        </tr> 
                        <tr>
                            <td align="right">
                                <asp:Label ID="StreetAddressZipLabel" runat="server" CssClass="labelSmall" AssociatedControlID="txtSAZip">Zip Code:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSAZip" runat="server" CssClass="formSmall"></asp:TextBox>  
                            </td>
                            <td align="right">
                                <asp:Label ID="ActiveLabel" runat="server" AssociatedControlID="ActiveCheckBox" Text="Active?:" CssClass="labelSmall"></asp:Label>
                            </td>
                            <td>
                                <asp:CheckBox ID="ActiveCheckBox" runat="server" CssClass="formRadio" Checked="true" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="ContactFirstNameLabel" runat="server" CssClass="labelSmall" AssociatedControlID="txtContactFirstName">Contact First Name:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtContactFirstName" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:Label ID="ContactLastNameLabel" runat="server" CssClass="labelSmall" AssociatedControlID="txtContactLastName">Contact Last Name:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtContactLastName" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                        </tr> 
                        <tr>
                            <td colspan="2">
                               <cc2:PhoneInputControl ID="PhoneNumberInputControl" runat="server" cssClassLabel="labelSmall" Required="true" Title="Telephone Number" cssClassControl="formSmall" EnableViewState="true" /> 
                            </td>
                            <td colspan="2">
                               <cc2:PhoneInputControl ID="FaxNumberInputControl" runat="server" cssClassLabel="labelSmall" Title="Fax Number" cssClassControl="formSmall" /> 
                            </td>
                        </tr> 
                        <tr>
                            <td align="right">
                                <asp:Label ID="EmailAddressLabel" runat="server" CssClass="labelSmall" AssociatedControlID="txtEmailAddress">Email Address:</asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmailAddress" runat="server" CssClass="formSmall"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:Label ID="CountyLabel" runat="server" CssClass="labelSmall" AssociatedControlID="ddlCounty">County:</asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlCounty" runat="server" CssClass="formSmall" Title="County" DataSourceID="CountyODS" DataTextField="Description" DataValueField="CountyId" ></asp:DropDownList>
                            </td>
                        </tr> 
                    </table>                
                </ItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        </asp:Panel>
                   </td></tr></table>   
        
        
        <asp:HiddenField ID="hfMode" runat="server" Value="INSERT" />
        <asp:HiddenField ID="hfFmsaId" runat="server" />

</asp:Content>

<asp:Content ID="FixedHeader" runat="server" ContentPlaceHolderID="ContentPlaceHolderFixedAdmin">
 <asp:Button ID="AddButton" runat="server" Text="Add Agency" />
    <asp:Button ID="SubmitButton" runat="server" Text="Submit" Visible="false" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" Visible="false"/>

</asp:Content>

